package com.wans.guli.integration.oauth;

import com.wans.guli.integration.vo.oauth.OAuthAccessParam;
import com.wans.guli.integration.vo.oauth.OAuthAccessVO;
import com.wans.guli.integration.vo.oauth.OAuthUserInfoVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "gitee", url = "https://gitee.com")
public interface GiteeFeignClient {

    @PostMapping("/oauth/token")
    @ResponseBody
    OAuthAccessVO getAccessToken(@RequestBody OAuthAccessParam param);

    @GetMapping("/api/v5/user")
    @ResponseBody
    OAuthUserInfoVO getUserInfo(@RequestParam("access_token") String accessToken);
}
